/**
 * Created by Administrator on 2017/7/20.
 */
$(function () {
    ajaxbox22();
})
function  ajaxbox22() {
    $.ajax({
        url : 'mstyle/getMSToView1.do',
        dataType : "json", // 返回格式为json
        type : "POST", // 请求方式
        success : function(req) {
            if(req.msg=="img"){
                var html = "";
                $(".box22  .b-content").html('');
                for(var i=0; i<req.obj.length; i++){
                    var p='<p class="mstyle-title">'+req.obj[i].mdescription+'</p>';
                    if(req.obj[i].mdescription==""){
                        p="";
                    }
                    html+='<div><a><img src="'+req.obj[i].picPath+'">'+p+'</a></div>';
                }
                $(".box22  .b-content").prepend('<div class="imgbox"></div>');
                $(".box22  .b-content .imgbox").html(html);
                jPicture(".box22 .b-content", {
                    type: "slide",
                    autoplay: 4000
                });
            }else{
                $(".box22  .b-content .imgbox").remove();
                $(".box22  .b-content").html('');
                if(req.obj.length>0){
                    $(".box22  .b-content").html('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id="b22movie">'+
                        '<param name="movie"  value="tools/vcastr22.swf?vcastr_file='+ req.obj[0].picPath +'&IsAutoPlay=1&IsContinue=1">'+
                        '<param name="quality" value="high"><param name="allowFullScreen" value="true" />'+
                        '<param name="IsAutoPlay" value="1" /><param name="IsContinue" value="1" />'+
                        '<embed src="tools/vcastr22.swf?vcastr_file='+ req.obj[0].picPath +'&IsAutoPlay=1&IsContinue=1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%">'+
                        '</embed></object>');
                    if(req.obj[0].mdescription!=""){
                        $(".box22  .b-content").prepend('<p class="mstyle-title1">'+req.obj[0].mdescription+'</p>');
                    }
                }
            }
        }
    });
}
function getdefaultimg(ele){
    $(ele).attr('src','static/images/003.gif');
}